<?php
require_once 'PDO.class.php';

class User extends PDOClass{

	public function __construct()
	{
		parent::__construct();
	}
	
	public function o_fLogin($username,$password)
	{
		$sql = "SELECT * FROM wof_user WHERE (user_email = '".$username."' OR user_username = '".$username."' ) AND user_password='".$password."'";
		$statement = $this->db->query($sql);
		$statement->execute();
		$statement->setFetchMode(PDO::FETCH_OBJ);	
		return $statement->fetch();
	}
	
	public function b_fInsert($a_Data)
	{
		$sql = "
		INSERT INTO wof_user (user_username,user_password, user_firstname, user_lastname,user_address, user_email,user_avatar)
		VALUES (?,?,?,?,?,?,?)";
		$statement = $this->db->prepare($sql);
		return $statement->execute($a_Data);
	}
}
$o_UserModel = new User();
?>
